﻿using System;
using System.Data;
/// <summary>
/// Summary description for DirectServiceLogin
/// </summary>
public class DirectPreventiveService
{
    private ConnectionBase sgbdr;
    public DirectPreventiveService()
    {
      sgbdr= new ConnectionBase();
    }
    public  DataTable GetPreventive(string whereClause)
    {
        string sql = "select distinct MAINTENANCEID, ,TYPEEQUIPMENT,NUMBEROFMONTHS,CONVERT(varchar, STARTDATE, 101) AS startdate,building.building from PREVENTIVEMAINTENANCE,employee,typeequipment,building,HAVE where(employee.employeeID=PREVENTIVEMAINTENANCE.employeeID and typeequipment.typeequipementid=HAVE.TYPEEQUIPEMENTID AND HAVE.HAVEID=PREVENTIVEMAINTENANCE.HAVEid and building.buildingid = PREVENTIVEMAINTENANCE.buildingid " + whereClause + " ) order By  MAINTENANCEID ";
        return sgbdr.consultSQL(sql).Tables[0];
       
    }

   
}
